using System.Collections.Generic;
using System.Linq;
using Dexter.DataTransferObject;

namespace Dexter.Domain.Model
{
	public static class TrackBackHelper
	{
		public static IList<TrackbackDto> ToDtos(this IEnumerable<TrackBack> trackBacks)
		{
			return trackBacks.Select(ToDto).ToList();
		}

		public static TrackbackDto ToDto(this TrackBack tb)
		{
			return new TrackbackDto
			       	{
			       		Excerpt = tb.Excerpt,
			       		Id = tb.Id,
			       		Name = tb.Name,
			       		Title = tb.Title,
			       		Url = tb.Url
			       	};
		}
	}
}